// Title Case a Sentence
// By DreamVB 23:23 17/10/2016

#include <iostream>

using namespace std;
using std::cout;
using std::endl;

int main(int argc, char *argv[]){
	char sentence[80];
	int i = 0;
	int len = 0;
	bool found = false;

	//Add some sample text
	strcpy(sentence, "today i went  for a  nise  stroll  in the park.");
	//Get length of string
	len = strlen(sentence);
	//Uppercase first letter
	sentence[0] = toupper(sentence[0]);

	while (i < len){
		//Check for space
		if (sentence[i] == '\ '){
			//Uppercase the char after the space.
			sentence[i + 1] = toupper(sentence[i + 1]);
		}
		//INC counter
		i++;
	}

	//Print out text
	cout << sentence << endl;

	system("pause");
	return 0;
}